﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProductCategory_Add.aspx.cs"
    MasterPageFile="~/Admin/Admin.Master" Inherits="TimKen.Web.Admin.ProductCategory.ProductCategory_Add" %>

<asp:Content ID="Content3" ContentPlaceHolderID="ContentLinkAction" runat="server">
    <span class="action-span"><a href="ProductCategory_List.aspx">
        <%=GetLangString("MenuProductCategory")%></a></span>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentTitle" runat="server">
    <%=GetLangString("AddProductCategory")%>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentMain" runat="server">

<script  type="text/javascript">

    function Upload() {
        var sk, sf, sp, ss;
        sk = "/FileUploadMain.aspx?syn=DSC";
        sf = "dialogWidth=420px;dialogHeight=200px;center=yes;help=no;resizable:no;status:no";
        sp = ""; ss = "";
        ss = showModalDialog(sk, sp, sf);
        if (ss != null && ss != "") {
            document.getElementById("<%=this.txtCategoryImage.ClientID%>").value = ss;
            document.getElementById("<%=this.btnRefresh.ClientID%>").click();
        }
    }
    
    
    function checkForm() {
        if (document.getElementById("<%=txtCategoryNameCn.ClientID%>").value == "" || document.getElementById("<%=txtCategoryNameEn.ClientID%>") == "") {
            alert(x_CategoryNameNotAllowBlank);
            return false;
        }
        return true;
    }
</script>

    <div class="main-div">
        <table width="100%" id="general-table">
            <tr>
                <th class="label">
                    <%=GetLangString("CategoryName")%>：
                </th>
                <td>
                    <ux:LanguagePic ID="LanguagePic1" runat="server" languageName="Chinese" />
                    <asp:TextBox ID="txtCategoryNameCn" runat="server"></asp:TextBox>
                    <ux:LanguagePic ID="LanguagePic2" runat="server" languageName="English" />
                    <asp:TextBox ID="txtCategoryNameEn" runat="server"></asp:TextBox>
                    <span class="require-field">*</span>
                </td>
            </tr>
            <tr>
                <th class="label">
                    <%=GetLangString("ParentCategory")%>：
                </th>
                <td>
                    <asp:DropDownList ID="ddlParentID" runat="server" Width="200px">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <th class="label">
                    前台显示列表模板：
                </th>
                <td>
                     <asp:DropDownList ID="ddlTemplate" runat="server" Width="250px">
                      <asp:ListItem  Text="原始模板(每行四个）【无描述】" Value="4"></asp:ListItem>
                     <asp:ListItem  Text="原始模板(每行四个）【有描述】" Value="1"></asp:ListItem>
                     <asp:ListItem  Text="列表模板(每行一个）" Value="2"></asp:ListItem>
                     <asp:ListItem  Text="主子列表模板(分别列表显示）" Value="3"></asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <th class="label">
                    <%=GetLangString("IsLeafCategory")%>：
                </th>
                <td>
                    <asp:CheckBox ID="chbIsLeaf" runat="server" />
                </td>
            </tr>
            <tr>
                <th class="label">
                    <%=GetLangString("CategoryImage")%>：
                </th>
                <td>
       <asp:TextBox  ID="txtCategoryImage" runat="server" Width="150px" style="display:none" ></asp:TextBox>
            <input type="button"  onclick="Upload()" value="上传"   id="btnUpload" runat="server"/>
        <asp:Button ID="btnDelete" Text="删除" runat="server"  CausesValidation="false" OnClick="btnDelete_Click"/><br />
  <asp:Image Width="200" Height="200" ID="imgCagegoryImage" runat="server" />
        <asp:Button ID="btnRefresh" Text="" runat="server"  CausesValidation="false" style="display:none"  OnClick="btnRefresh_Click"/>              
                </td>
            </tr>
            
              <tr>
                <th class="label">
                    <%=GetLangString("Description")%>：
                </th>
                <td>
                
                <ux:LanguagePic ID="LanguagePic3" runat="server" languageName="Chinese" />
                    <asp:TextBox ID="txtDescriptionCn"  TextMode = "MultiLine"  runat="server"    Width="250px" Rows="10" ></asp:TextBox>
                    <ux:LanguagePic ID="LanguagePic4" runat="server" languageName="English" />
                    <asp:TextBox ID="txtDescriptionEn" runat="server" TextMode = "MultiLine"  Width="250px" Rows="10" ></asp:TextBox>
                  
                    
                    
                
                </td>
            </tr>
            
            
            
            
            <tr>
                <th class="label">
                    <%=GetLangString("DateAdded")%>：
                </th>
                <td>
                    <asp:TextBox ID="txtDateAdded" runat="server" ReadOnly="true"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <th class="label">
                    <%=GetLangString("LastModified")%>：
                </th>
                <td>
                    <asp:TextBox ID="txtLastModified" runat="server" ReadOnly="true"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <div class="button-div">
                        <asp:Button Text="" runat="server" CssClass="button" ID="btnSubmit" Width="50px"
                            OnClientClick="return checkForm(); " OnClick="btnSubmit_Click" />&nbsp;&nbsp;
                        <asp:Button Text="" runat="server" CssClass="button" ID="btnChangeIsLeaf" OnClick="btnChangeIsLeaf_Click" />&nbsp;&nbsp;
                        <input type="reset" class="button" value='<%=GetLangString("Reset")%>' />
                    </div>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
